import { Button, Result } from "antd";
import { FC, ReactNode } from "react"

const ResultWrap: FC<{
    children: ReactNode, error: Error | undefined, reload?: () => void
}> = ({ children, error, reload }) => {
    return <>
        {error ? <Result status="error" title="加载错误" subTitle={error.message} extra={[reload && <Button onClick={reload}>重新加载</Button>]}></Result> :
            children}
    </>
}
export default ResultWrap